<%@ page pageEncoding="UTF-8"%>

<%@include file="/util/tag.jsp"%>
<ul id="menu">
	<li><a href="<%=request.getContextPath()%>/index" class="index_off"></a></li>

	<s:if test="#session['user.urls'].contains('/role/list')">
		<li><a href="<%=request.getContextPath()%>/role/list"
			class="role_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/admin/list')">
		<li><a href="<%=request.getContextPath()%>/admin/list"
			class="admin_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/cost/list')">
		<li><a href="<%=request.getContextPath()%>/cost/list"
			class="fee_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/account/list')">
		<li><a href="<%=request.getContextPath()%>/account/list"
			class="account_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/service/list')">
		<li><a href="<%=request.getContextPath()%>/service/list"
			class="service_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/bill/list')">
		<li><a href="<%=request.getContextPath()%>/bill/list"
			class="bill_off"></a></li>
	</s:if>
	<s:if test="#session['user.urls'].contains('/report/list')">
		<li><a href="<%=request.getContextPath()%>/report/list"
			class="report_off"></a></li>
	</s:if>

	<li><a href="<%=request.getContextPath()%>/user/user_info"
		class="information_off"></a></li>
	<li><a href="<%=request.getContextPath()%>/user/modi_pwd"
		class="password_off"></a></li>
</ul>

<script>
	$(function() {
		var menu = document.getElementById("menu");
		var menuLi = menu.getElementsByTagName("li");
		var windowHref = window.location.href;
		
		for (var i = 0; i < menuLi.length; i++) {
			var obj = menuLi[i].children[0];
			if(windowHref.indexOf(obj.pathname.substr(0,obj.pathname.lastIndexOf("/")))!=-1){
				obj.className = obj.className.replace("off","on");
			}
        }
		
	})
</script>

